<template>
  <!-- 新增录入画面对话框-->
  <el-dialog
    :title="title"
    center
    :visible.sync="openState"
    width="1024px"
    :close-on-click-modal="false"
    :before-close="handleClose"
    v-if="openState"
  >
    <el-form ref="editForm" :model="form" :rules="rules" label-width="110px">
      <!--交易础信息-->
      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select
                v-model="form.bizTypeCode"
                placeholder="业务类型"
                @change="bizTypeCodeChange"
                :disabled="ifShowDelBtn"
              >
                <el-option
                  v-for="dict in dictMap.BIZ_TYPE_127"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select v-model="form.bizCtgyCode" placeholder="业务种类" :disabled="ifShowDelBtn">
                <el-option
                  v-for="dict in busTypeList"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <!--          <el-col :span="8">
                      <el-form-item label="记账标志" prop="cbflag">
                        <el-select v-model="form.cbflag" placeholder="记账标志" :disabled="ifShowDelBtn">
                          <el-option
                            v-for="dict in dictMap.CBFLAG"
                            :key="dict.value"
                            :label="`${dict.value}-${dict.text}`"
                            :value="dict.value"
                          ></el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>-->
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="货币币种" prop="curcd">
              <el-input v-model="form.curcd" :disabled="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="现金金额" prop="amount">
              <ht-amount-input
                v-model="form.amount"
                placeholder="现金金额"
                :disable="isamountdisable"
              ></ht-amount-input>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="大写金额" prop="bAmount">
              <ht-amount-upper :inputValue="form.amount" placeholder="交易金额" style="width: 195px"></ht-amount-upper>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="8">
            <el-form-item label="回执期限" prop="pkgRtrltd">
              <acct-no-input v-model="form.pkgRtrltd" placeholder="回执期限"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="地域标识编号" prop="regionid">
              <el-select v-model="form.regionid" placeholder="地域标识编号">
                <el-option
                  v-for="dict in dictMap.RegionId"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="账户类型" prop="custflag1">
              <el-select v-model="form.custflag1" placeholder="账户类型">
                <el-option
                  v-for="dict in dictMap.CUST_FLAG1"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="合同协议号" prop="contractNo">
              <el-input type="textarea" v-model="form.contractNo" maxlength="60" show-word-limit/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言" prop="remark">
              <el-input type="textarea" v-model="form.remark" maxlength="256" :disabled="isremarkdisable"
                        show-word-limit/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--收款人信息-->
      <el-card class="form-card payeeInfo-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <div class="grid-payee">
              <el-form-item label="收款人账号" prop="payeeActno">
                <acct-no-input
                  v-model="form.payeeActno"
                  placeholder="收款人账号"
                  @keyup.enter.native="getActNoInfo('payeeActNo')"
                />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-payee">
              <el-button type="primary" icon="el-icon-search" plain @click="openPayeeDialog('payeeActno')">
                账号查找
              </el-button>
            </div>
          </el-col>
        </el-row>
        <el-form-item label="收款人名称" prop="payeeName">
          <el-input v-model="form.payeeName" placeholder="收款人名称"/>
        </el-form-item>
        <el-form-item label="收款人地址" prop="payeeAddr">
          <el-input v-model="form.payeeAddr" placeholder="收款人地址"/>
        </el-form-item>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input
                  v-model="form.payeeBrno"
                  placeholder="收款行行号"
                  :disabled="true"
                  @keyup.enter.native="getBankInf('payeeBrno', form.payeeBrno)"
                />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-payee">
              <el-form-item></el-form-item>
            </div>
          </el-col>
          <el-col :span="13">
            <el-form-item label="收款行行名" prop="payeeBrname" label-width="130px">
              <el-input v-model="form.payeeBrname" placeholder="收款行行名" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <acct-no-input
                  v-model="form.payeeAccBrno"
                  placeholder="收款人开户行行号"
                  @keyup.enter.native="getBankInf('payeeAccBrno', form.payeeAccBrno)"
                />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-payee">
              <el-button type="primary" icon="el-icon-search" plain @click="openBankBranchDialog('payeeAccBrno')">
                行号查找
              </el-button>
            </div>
          </el-col>
          <el-col :span="13">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrname" label-width="130px">
              <el-input v-model="form.payeeAccBrname" placeholder="收款人开户行行名"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <!--付款人信息-->
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <acct-no-input
                v-model="form.payerActno"
                placeholder="付款人账号"
                @keyup.enter.native="getActNoInfo('payerActNo')"
                :disabled="ispayerActnodisable"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-row>
              <el-button
                type="primary"
                icon="el-icon-search"
                plain
                @click="openPayerDialog('payerActno')"
                :style="{ display: payerActnobuttonhidden }"
              >
                账号查找
              </el-button>
            </el-row>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="付款人名称" prop="payerName">
            <el-input v-model="form.payerName" placeholder="付款人名称" :disabled="ispayerNamedisable"/>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="付款人地址" prop="payerAddr">
            <el-input v-model="form.payerAddr" placeholder="付款人地址"/>
          </el-form-item>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款行行号" prop="payerBrno">
                <acct-no-input
                  v-model="form.payerBrno"
                  placeholder="付款行行号"
                  @keyup.enter.native="getBankInf('payerBrno', form.payerBrno)"
                />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="3">
            <el-button type="primary" icon="el-icon-search" plain @click="openBankBranchDialog('payerBrno')">
              行号查找
            </el-button>
          </el-col>
          <el-col :span="13">
            <el-form-item label="付款行行名" prop="payerBrname" label-width="130px">
              <el-input v-model="form.payerBrname" placeholder="付款行行名" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款人开户行号" prop="payerAccBrno">
                <acct-no-input
                  v-model="form.payerAccBrno"
                  placeholder="付款人开户行行号"
                  @keyup.enter.native="getBankInf('payerAccBrno', form.payerAccBrno)"
                />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-payer">
              <el-button type="primary" icon="el-icon-search" plain @click="openBankBranchDialog('payerAccBrno')">
                行号查找
              </el-button>
            </div>
          </el-col>
          <el-col :span="13">
            <el-form-item label="付款人开户行行名" prop="payerAccBrname" label-width="130px">
              <el-input v-model="form.payerAccBrname" placeholder="付款人开户行行名" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <div v-if="this.form.bizTypeCode === 'B104'">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>国库资金借记划拨附加数据域</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报表日期" prop="reportDate1">
                <el-date-picker v-model="form.reportDate1" placeholder="报表日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="报表序号" prop="reportNumbe1">
                <acct-no-input v-model="form.reportNumbe1" placeholder="报表序号"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="上报国库代码" prop="reportCode1">
                <acct-no-input v-model="form.reportCode1" placeholder="上报国库代码"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收国库代码" prop="receiveCode1">
                <acct-no-input v-model="form.receiveCode1" placeholder="接收国库代码"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="预算级次" prop="budgetLevel1">
                <el-select style="width: 100%" v-model="form.budgetLevel1" placeholder="预算级次">
                  <el-option
                    v-for="dict in dictMap.BUDGETLEVELCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="预算种类" prop="budgetType1">
                <el-select style="width: 100%" v-model="form.budgetType1" placeholder="预算种类">
                  <el-option
                    v-for="dict in dictMap.BUDGETTYPECODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="调整期标志" prop="indicatorCode1">
                <el-select style="width: 100%" v-model="form.indicatorCode1" placeholder="调整期标志">
                  <el-option
                    v-for="dict in dictMap.INDICATOR_CODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>明细列表</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="明细条数" prop="dtlCount1">
                <el-input v-model="form.dtlCount1" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="明细汇总币种" prop="dtlCurcd1">
                <el-input v-model="form.dtlCurcd1" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="明细汇总金额" prop="dtlAmount1">
                <ht-amount-input v-model="form.dtlAmount1" placeholder="明细汇总金额" :disable="true"></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>
            <div class="discountReceipt-pick-operate-box">
              <div class="operate-box-bottom-paging">
                <div class="bottom-content">
                  <ht-table
                    ref="dataTable104"
                    :showSerialNumber="false"
                    :multi-select="false"
                    :opButtonList="opButtonList104"
                    :queryParams="queryParams"
                    :tableBindColumns="tableBindColumns104"
                    :showRightToolbar="true"
                    :randomRowKey="true"
                    :showPagination="false"
                  >
                    <template v-slot:operate>
                      <el-table-column
                        label="操作"
                        align="left"
                        width="120"
                        fixed="right"
                        class-name="small-padding fixed-width"
                      >
                        <template slot-scope="scope">
                          <ht-button-group
                            :buttonList="[
                              {
                                label: '删除',
                                doFunc: () => {
                                  remove104(scope.row, scope.$index);
                                },
                              },
                              {
                                label: '修改',
                                doFunc: () => {
                                  update104(scope.row, scope.$index);
                                },
                              },
                            ]"
                          />
                        </template>
                      </el-table-column>
                    </template>
                  </ht-table>
                </div>
              </div>
            </div>
          <el-pagination
            background
            @size-change="handleSizeChange104"
            @current-change="handleCurrentChange104"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30, 50]"
            :page-size="pageSize"
            layout="->,total, sizes, prev, pager, next, jumper"
            :total="detailList104.length">
          </el-pagination>
        </el-card>
      </div>

      <div v-if="this.form.bizTypeCode === 'B307'">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>国库资金国债兑付借记划拨附加数据域</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报表日期" prop="reportDate2">
                <el-date-picker v-model="form.reportDate2" placeholder="报表日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="报表序号" prop="reportNumbe2">
                <acct-no-input v-model="form.reportNumbe2" placeholder="报表序号"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="上报国库代码" prop="reportCode2">
                <acct-no-input v-model="form.reportCode2" placeholder="上报国库代码"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收国库代码" prop="receiveCode2">
                <acct-no-input v-model="form.receiveCode2" placeholder="接收国库代码"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>明细列表</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="明细条数" prop="dtlCount2">
                <el-input v-model="form.dtlCount2" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="明细汇总币种" prop="dtlCurcd2">
                <el-input v-model="form.dtlCurcd2" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="明细汇总金额" prop="dtlAmount2">
                <ht-amount-input v-model="form.dtlAmount2" placeholder="明细汇总金额" :disable="true"></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>
           <div class="discountReceipt-pick-operate-box">
              <div class="operate-box-bottom-paging">
                <div class="bottom-content">
                  <ht-table
                    ref="dataTable307"
                    :showSerialNumber="false"
                    :multi-select="false"
                    :opButtonList="opButtonList307"
                    :tableBindColumns="tableBindColumns307"
                    :showRightToolbar="false"
                    :initData="true"
                    :queryParams="queryParams"
                    :randomRowKey="true"
                    :showPagination="false"
                  >
                    <template v-slot:operate>
                      <el-table-column
                        label="操作"
                        align="left"
                        width="120"
                        fixed="right"
                        class-name="small-padding fixed-width"
                      >
                        <template slot-scope="scope">
                          <ht-button-group
                            :buttonList="[
                              {
                                label: '删除',
                                doFunc: () => {
                                  remove307(scope.row, scope.$index);
                                },
                              },
                              {
                                label: '修改',
                                doFunc: () => {
                                  update307(scope.row, scope.$index);
                                },
                              },
                            ]"
                          />
                        </template>
                      </el-table-column>
                    </template>
                  </ht-table>
                </div>
              </div>
            </div>
          <el-pagination
            background
            @size-change="handleSizeChange307"
            @current-change="handleCurrentChange307"
            :current-page="currentPage307"
            :page-sizes="[10, 20, 30, 50]"
            :page-size="pageSize307"
            layout="->,total, sizes, prev, pager, next, jumper"
            :total="detailList307.length">
          </el-pagination>
        </el-card>
      </div>

      <div v-if="this.form.bizTypeCode === 'B308'">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>小额支付系统支票截留业务附加数据</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票日期" prop="issueDate">
                <el-date-picker v-model="form.issueDate" placeholder="出票日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="提示付款日期" prop="payDate">
                <el-date-picker v-model="form.payDate" placeholder="提示付款日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="支票号码" prop="noteNumber">
                <acct-no-input v-model="form.noteNumber" placeholder="支票号码"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="支付密码" prop="payPassword">
                <acct-no-input v-model="form.payPassword" placeholder="支付密码"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="用途" prop="use">
                <el-input type="textarea" v-model="form.use" show-word-limit maxlength="256"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </div>

      <div
        v-if="this.form.bizTypeCode === 'B309' || this.form.bizTypeCode === 'B310' || this.form.bizTypeCode === 'B311'"
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>小额支付系统通用票据截留业务附加数据</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票日期" prop="issueDate_B309">
                <el-date-picker v-model="form.issueDate_B309" placeholder="出票日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票货币币种" prop="issueCurrcd">
                <el-input v-model="form.issueCurrcd" :disabled="true" placeholder="出票货币币种"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出票金额" prop="issueAmount">
                <ht-amount-input v-model="form.issueAmount" placeholder="出票金额"></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="提示付款日期" prop="payDate_B309">
                <el-date-picker v-model="form.payDate_B309" placeholder="提示付款日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="票据到期日期" prop="draftMaturity">
                <el-date-picker v-model="form.draftMaturity" placeholder="票据到期日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="票据号码" prop="noteNumber">
                <acct-no-input v-model="form.noteNumber" placeholder="票据号码"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="支付密码" prop="payPassword">
                <acct-no-input v-model="form.payPassword" placeholder="支付密码"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="票据密押" prop="draftKey">
                <acct-no-input v-model="form.draftKey" placeholder="票据密押"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="承兑协议编号" prop="protoNo">
                <acct-no-input v-model="form.protoNo" placeholder="承兑协议编号"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="承兑日期" prop="acceptDate">
                <el-date-picker v-model="form.acceptDate" placeholder="承兑日期" style="width: 100%" type="date"
                                value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="承兑人" prop="acceptor">
                <el-input v-model="form.acceptor" placeholder="承兑人"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请人账号" prop="applyAccount">
                <acct-no-input v-model="form.applyAccount" placeholder="申请人账号"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="申请人名称" prop="applyName">
                  <el-input v-model="form.applyName" placeholder="申请人名称"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票人账号" prop="issueAccount">
                <acct-no-input v-model="form.issueAccount" placeholder="出票人账号"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="出票人全称" prop="issueName">
                <el-input v-model="form.issueName" placeholder="出票人全称"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易合同号码" prop="pactNumber">
                <acct-no-input v-model="form.pactNumber" placeholder="交易合同号码"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="用途" prop="use">
                <el-input type="textarea" v-model="form.use" show-word-limit maxlength="256"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </div>

      <div
        v-if="
          this.form.bizTypeCode === 'B308' ||
          this.form.bizTypeCode === 'B309' ||
          this.form.bizTypeCode === 'B310' ||
          this.form.bizTypeCode === 'B311'
        "
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>被背书人清单</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="被背书人数" prop="endorserNumber">
                <el-input v-model="form.endorserNumber" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="原收款人名称" prop="oriPayeeName">
                <el-input v-model="form.oriPayeeName" placeholder="原收款人名称"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="被背书人名称" prop="endorserName">
                <el-input v-model="form.endorserName" placeholder="被背书人名称"/>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <div class="grid-payee">
                <el-button type="primary" icon="el-icon-search" plain @click="addListEndorser">添加</el-button>
              </div>
            </el-col>
          </el-row>
          <div class="discountReceipt-pick-operate-box">
            <div class="operate-box-bottom-paging">
              <div class="bottom-content">
                 <ht-table
                    ref="dataTableEndorser"
                    :showSerialNumber="false"
                    :multi-select="false"
                    :tableBindColumns="tableBindColumnsEndorser"
                    :showRightToolbar="false"
                    :initData="true"
                    :randomRowKey="true"
                    :queryParams="queryParams"
                    :showPagination="false"
                 >
                    <template v-slot:operate>
                      <el-table-column
                        label="操作"
                        align="left"
                        width="120"
                        fixed="right"
                        class-name="small-padding fixed-width"
                      >
                        <template slot-scope="scope">
                          <ht-button-group
                            :buttonList="[
                              {
                                label: '删除',
                                doFunc: () => {
                                  removeEndorser(scope.row, scope.$index);
                                },
                              },
                            ]"
                          />
                        </template>
                      </el-table-column>
                    </template>
                  </ht-table>
                <el-pagination
                  background
                  @size-change="handleSizeChangeEndorser"
                  @current-change="handleCurrentChangeEndorser"
                  :current-page="endorserCurPage"
                  :page-sizes="[10, 20, 30, 50]"
                  :page-size="endorserPageSize"
                  layout="->,total, sizes, prev, pager, next, jumper"
                  :total="endorserList.length">
                </el-pagination>
              </div>
            </div>
          </div>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>票据影像</span>
          </div>

          <el-row>
            <el-col :span="12">
              <el-form-item label="票据正面图像" prop="imgFrnName">
                <!-- <file-upload-input></file-upload-input> -->
                <ht-upload-form-item
                  ref="frnattachmentFormItem"
                  :limit="{
                    size: 0,
                    fileCount: 1,
                    type: ['jpg', 'jpeg', 'png'],
                  }"
                  v-model="form.imgFrnName"
                  @successCallback="frnsuccessCallback"
                ></ht-upload-form-item>
                <div v-if="this.form.imgFrnFileName !== undefined">
                  <el-input v-model="form.imgFrnFileName" :disabled="true"/>
                  <el-button type="primary" icon="el-icon-search" plain @click="downloadFile(form.imgFrnDownload)">
                    下载
                  </el-button>
                </div>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="票据背面图像" prop="imgBckName">
                <!-- <file-upload-input></file-upload-input> -->
                <ht-upload-form-item
                  ref="bckattachmentFormItem"
                  :limit="{
                    size: 0,
                    fileCount: 1,
                    type: ['jpg', 'jpeg', 'png'],
                  }"
                  v-model="form.imgBckName"
                  @successCallback="bcksuccessCallback"
                ></ht-upload-form-item>
                <div v-if="this.form.imgBckFileName !== undefined">
                  <el-input v-model="form.imgBckFileName" :disabled="true"/>
                  <el-button type="primary" icon="el-icon-search" plain @click="downloadFile(form.imgDownload)">
                    下载
                  </el-button>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </div>

      <div v-if="this.form.bizTypeCode === 'A119'">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>广西非票据截留业务附言</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交换日期" prop="chgDate">
                <el-date-picker v-model="form.chgDate" style="width: 100%" type="date" value-format="yyyyMMdd"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="交换场次" prop="chgField">
                <acct-no-input v-model="form.chgField"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="提出交换区域" prop="outRegionid">
                <el-select style="width: 100%" v-model="form.outRegionid" placeholder="提出交换区域">
                  <el-option
                    v-for="dict in dictMap.RegionId"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="提入交换区域" prop="inRegionid">
                <el-select style="width: 100%" v-model="form.inRegionid" placeholder="提入交换区域">
                  <el-option
                    v-for="dict in dictMap.RegionId"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </div>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm(null)">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
      <el-button v-show="ifShowDelBtn" type="danger" @click="delTran">删 除</el-button>
    </div>
    <bank-branch-dialog ref="bankBranchDialog" @confirm="confirmBankBranch"></bank-branch-dialog>
    <payee-dialog ref="payeeDialog" @confirm="confirmPayee"></payee-dialog>
    <payer-dialog ref="payerDialog" @confirm="confirmPayer"></payer-dialog>
    <list-b104
      ref="listB104Dialog"
      @confirm="confirmlistB104detail"
      :dictMap="this.dictMap"
      :formData.sync="this.form"
    ></list-b104>
    <list-b307
      ref="listB307Dialog"
      @confirm="confirmlistB307detail"
      :dictMap="this.dictMap"
      :formData.sync="this.form"
    ></list-b307>
  </el-dialog>
</template>
<script>
import {addTxn, updTxn} from "@/api/cnaps/baseBiz/send/hvps/hvps.js";
import {detail, delTxn, detailByCode} from "@/api/cnaps/baseBiz/send/sendCommon.js";
import {getOtherCustByActno, getCustByActno} from "@/api/cnaps/common/custInfo";
import {getBankInfByBankCode} from "@/api/cnaps/common/bankInfo";
import {isLessThenHvpsMinLimitNew} from "@/api/cnaps/common/cp2SysParam";
import BankBranchDialog from "@/views/components/BankBranchDialog";
import PayerDialog from "@/views/components/PayeeDialog";
import PayeeDialog from "@/views/components/PayerDialog";
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";
import AcctNoInput from "@/views/components/AcctNoInput/index.vue";
import ListB104 from "@/views/cnaps/baseBiz/send/beps/beps125/components/listB104";
import ListB307 from "@/views/cnaps/baseBiz/send/beps/beps125/components/listB307";
import {checkRcvStBrnoStatus} from "@/api/cnaps/common/check";
import {
  add127,
  apiUrlConfig104,
  apiUrlConfig307,
  apiUrlConfigEndorserTab,
  bepsDebitBusinessModifyDetail,
  update127,
} from "@/api/cnaps/baseBiz/send/beps/beps";
import {mapGetters} from "vuex";
import defaultSettings from "@/settings";
import {baseUrlConfig, downloadfile} from "@/api/authority_app/base";

export default {
  name: "EditInfo",
  components: {
    ListB307,
    ListB104,
    PayeeDialog,
    PayerDialog,
    BankBranchDialog,
    HtAmountInput,
    HtAmountUpper,
    AcctNoInput
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },

  data() {
    let payDateVaildate = (rule, value, callback) => {
      if (this.form.bizTypeCode === "B309" || this.form.bizTypeCode === "B310" || this.form.bizTypeCode === "B311") {
        if (value !== "" && this.form.issueDate_B309 !== "") {
          if (this.form.issueDate_B309 > value) {
            callback(new Error("提示付款日期大于等于出票日期"));
          } else {
            callback();
          }
        } else {
          callback();
        }
      } else {
        callback();
      }
    };

    let draftMaturityVaildate = (rule, value, callback) => {
      if (this.form.bizTypeCode === "B309" || this.form.bizTypeCode === "B310" || this.form.bizTypeCode === "B311") {
        if (value !== "" && this.form.issueDate_B309 !== "") {
          if (this.form.issueDate_B309 > value) {
            callback(new Error("票据到期日期大于等于出票日期"));
          } else {
            callback();
          }
        } else {
          callback();
        }

        if (value !== "" && this.form.payDate_B309 !== "") {
          if (this.form.payDate_B309 > value) {
            callback(new Error("票据到期日期大于提示付款日"));
          } else {
            callback();
          }
        } else {
          callback();
        }

        if (value !== "" && this.form.acceptDate !== "") {
          if (this.form.acceptDate > value) {
            callback(new Error("票据到期日期小于等于汇票到期日"));
          } else {
            callback();
          }
        } else {
          callback();
        }
      } else {
        callback();
      }
    };

    let acceptDateVaildate = (rule, value, callback) => {
      if (this.form.bizTypeCode === "B309" || this.form.bizTypeCode === "B310" || this.form.bizTypeCode === "B311") {
        if (value !== "" && this.form.issueDate_B309 !== "") {
          if (this.form.issueDate_B309 > value) {
            callback(new Error("承兑日期大于等于出票日期"));
          } else {
            callback();
          }
        } else {
          callback();
        }
      } else {
        callback();
      }
    };

    return {
      currentPage: 1,
      currentPage307: 1,
      pageSize: 20,
      pageSize307: 20,
      detailList104: [],
      detailList307: [],
      endorserCurPage:1,
      endorserPageSize: 20,
      endorserList:[],
      busTypeList: [],
      id: "",
      title: "",
      pkgNo: "",
      // 是否显示弹出层
      openState: false,
      ifShowDelBtn: false,

      isamountdisable: false,
      isremarkdisable: false,

      ispayerActnodisable: false,
      ispayerNamedisable: false,

      payerActnobuttonhidden: "",

      reqConfig104: apiUrlConfig104,

      reqConfig307: apiUrlConfig307,

      reqConfigEndorser: apiUrlConfigEndorserTab,

      queryParams: {
        id: "",
      },

      //104table
      tableBindColumns104: [
        {prop: "deptCode", label: "征收机关大类代码", dictCode: "DEPT_CODE"},
        {prop: "subjectCode", label: "预算科目代码"},
        {prop: "curcd", label: "发生额币种"},
        {prop: "amount", label: "发生额", type: "price"},
      ],
      //307table
      tableBindColumns307: [
        {prop: "debtBankType", label: "兑付国债银行大类", dictCode: "DEBT_BANK_TYPE127", width: 180},
        {prop: "capitalCode", label: "本金代码"},
        {prop: "capitalCurcd", label: "本金金额币种", width: 180},
        {prop: "capitalAmount", label: "本金金额", type: "price"},
        {prop: "accrualCode", label: "利息代码"},
        {prop: "accrualCurcd", label: "利息金额币种", width: 180},
        {prop: "accrualAmount", label: "利息金额", type: "price"},
      ],
      //背书表格
      tableBindColumnsEndorser: [{prop: "endorserName", label: "被背书人名称"}],
      opButtonList104: () => {
        return [
          {
            label: "新增",
            type: "primary",
            icon: "el-icon-plus",
            actionType: "add",
            clickFun: () => {
              this.addRow104();
            },
          },
        ];
      },

      opButtonList307: () => {
        return [
          {
            label: "新增",
            type: "primary",
            icon: "el-icon-plus",
            actionType: "add",
            clickFun: () => {
              this.addRow307();
            },
          },
        ];
      },
      // 字段可编辑控制

      // 表单参数
      form: {
        amount: 0.00,
        listB104: [],
        listB307: [],
        listEndorser: [],
      },
      // 表单校验
      rules: {
        bizTypeCode: {required: true, message: "请输入业务类型", trigger: "blur"},
        bizCtgyCode: {required: true, message: "请输入业务种类", trigger: "blur"},
        custflag1: [{required: true, message: "请选择账户类型", trigger: "change"}],
        // cbflag: { required: true, message: "请输入记账标识", trigger: "blur" },
        pkgRtrltd: [
          {required: true, message: "请输入回执期限", trigger: "blur"},
          {max: 2, message: "最大长度为2位", trigger: "blur"},
        ],
        payeeBrno: [
          {required: true, message: "请输入收款行行号", trigger: "blur"},
          {max: 14, message: "最大长度为14位", trigger: "blur"},
        ],
        payeeBrname: {max: 60, message: "最大长度为60位", trigger: "blur"},
        payeeAccBrno: [
          {required: true, message: "请输入收款人开户行号", trigger: ['blur', 'change']},
          {max: 14, message: "最大长度为14位", trigger: "blur"},
        ],
        payeeAccBrname: {max: 60, message: "最大长度为60位", trigger: "blur"},
        payeeActno: [
          {required: true, message: "请输入收款人账号", trigger: ['blur', 'change']},
          {max: 32, message: "最大长度为32位", trigger: "blur"},
        ],
        payeeName: [
          {required: true, message: "请输入收款人名称", trigger: ['blur', 'change']},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        payeeAddr: {max: 70, message: "最大长度为70位", trigger: "blur"},
        payerActno: [
          {required: true, message: "请输入付款人账号", trigger: ['blur', 'change']},
          {max: 32, message: "最大长度为32位", trigger: "blur"},
        ],
        payerName: [
          {required: true, message: "请输入付款人名称", trigger: "blur"},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        payerAddr: {max: 70, message: "最大长度为70位", trigger: "blur"},
        payerBrno: [
          {required: true, message: "请输入付款行行号", trigger: ['blur', 'change']},
          {max: 14, message: "最大长度为14位", trigger: "blur"},
        ],
        payerBrname: {max: 60, message: "最大长度为60位", trigger: "blur"},
        payerAccBrno: [
          {required: true, message: "请输入付款人开户行号", trigger: ['blur', 'change']},
          {max: 14, message: "最大长度为14位", trigger: "blur"},
        ],
        payerAccBrname: {max: 60, message: "最大长度为60位", trigger: "blur"},
        curcd: {max: 3, message: "最大长度为3位", trigger: "blur"},
        contractNo: {max: 60, message: "最大长度为60位", trigger: "blur"},
        remark: {max: 256, message: "最大长度为256位", trigger: "blur"},
        reportDate1: {required: true, message: "请输入报表日期", trigger: "blur"},
        reportNumbe1: [
          {required: true, message: "请输入报表序号", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        reportCode1: [
          {required: true, message: "请输入上报国库代码", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        receiveCode1: [
          {required: true, message: "请输入接收国库代码", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        budgetLevel1: {required: true, message: "请输入预算级次", trigger: "blur"},
        budgetType1: {required: true, message: "请输入预算种类", trigger: "blur"},
        indicatorCode1: {required: true, message: "请输入调整期标志", trigger: "blur"},
        reportDate2: {required: true, message: "请输入报表日期", trigger: "blur"},
        reportNumbe2: [
          {required: true, message: "请输入报表序号", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        reportCode2: [
          {required: true, message: "请输入上报国库代码", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        receiveCode2: [
          {required: true, message: "请输入接收国库代码", trigger: "blur"},
          {max: 10, message: "最大长度为10位", trigger: "blur"},
        ],
        issueDate: {required: true, message: "请输入出票日期", trigger: "blur"},
        issueDate_B309: {required: true, message: "请输入出票日期", trigger: "blur"},
        payDate: {required: true, message: "请输入提示付款日期", trigger: "blur"},
        noteNumber: [
          {required: true, message: "请输入票据号码", trigger: "blur"},
          {max: 16, message: "最大长度为16位", trigger: "blur"},
        ],
        payPassword: {max: 512, message: "最大长度为512位", trigger: "blur"},
        use: {max: 256, message: "最大长度为256位", trigger: "blur"},
        issueCurrcd: {max: 3, message: "最大长度为3位", trigger: "blur"},
        issueAmount: [
          {required: true, message: "请输入出票金额", trigger: "blur"}
        ],
        amount: [{required: true, message: "请输入现金金额", trigger: "blur"}],
        draftKey: [
          {required: false, message: "请输入票据密押", trigger: "blur"},
          {max: 20, message: "最大长度为20位", trigger: "blur"},
        ],
        protoNo: [
          {required: false, message: "请输入承兑协议编号", trigger: "blur"},
          {max: 30, message: "最大长度为30位", trigger: "blur"},
        ],
        acceptor: [
          {required: false, message: "请输入承兑人", trigger: "blur"},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        applyAccount: [
          {required: true, message: "请输入申请人账号", trigger: "blur"},
          {max: 32, message: "最大长度为32位", trigger: "blur"},
        ],
        applyName: [
          {required: false, message: "请输入申请人名称", trigger: "blur"},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        issueAccount: [
          {required: false, message: "请输入出票人账号", trigger: "blur"},
          {max: 32, message: "最大长度为32位", trigger: "blur"},
        ],
        issueName: [
          {required: false, message: "请输入出票人全称", trigger: "blur"},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        pactNumber: [
          {required: false, message: "请输入交易合同号码", trigger: "blur"},
          {max: 30, message: "最大长度为30位", trigger: "blur"},
        ],
        oriPayeeName: [
          {required: false, message: "请输入原收款人名称", trigger: "blur"},
          {max: 60, message: "最大长度为60位", trigger: "blur"},
        ],
        endorserNumber: [{required: true, message: "请输入被背书人数", trigger: "blur"}],
        endorserName: [{required: true, message: "请输入被背书人名称", trigger: "blur"},
          {max: 60, message: "被背书人名称最长为60位", trigger: "blur"}],
        chgDate: {required: true, message: "请输入交换日期", trigger: "blur"},
        chgField: [{required: true, message: "请输入交换场次", trigger: "blur"},
          {max: 1, message: "交换场次最长为1位", trigger: "blur"}],
        outRegionid: {required: true, message: "请输入提出交换区域", trigger: "blur"},
        inRegionid: {required: true, message: "请输入提入交换区域", trigger: "blur"},
        draftMaturity: [
          {required: true, message: "请输入票据到期日期", trigger: "blur"},
          {validator: draftMaturityVaildate, trigger: "blur"},
        ],
        acceptDate: [
          {required: false, message: "请输入承兑日期", trigger: "blur"},
          {validator: acceptDateVaildate, trigger: "blur"},
        ],
        imgFrnName: [
          {required: true, message: "请上传票据正面图像", trigger: "blur"},
        ],
        imgBckName: [
          {required: true, message: "请上传票据背面图像", trigger: "blur"},
        ],
        payDate_B309: [{required: true, message: "请输入提示付款日期", trigger: "blur"},
          {validator: payDateVaildate, trigger: "blur"}],
      },
    };
  },
  computed: {
    feeIdRegionidChange() {
      const {endorserNumber, bizCtgyCode} = this;
      return {endorserNumber: this.form.endorserNumber, bizCtgyCode: this.form.bizCtgyCode};
    },
    ...mapGetters(["globalBusData"]),
  },
  created() {
    this.$set(this.form, "payeeBrno", this.globalBusData.cnapsBrno);
    this.$set(this.form, "payeeBrname", this.globalBusData.cnapsBrname);
    this.$set(this.form, "payeeAccBrno", this.globalBusData.cnapsBrno);
    this.$set(this.form, "payeeAccBrname", this.globalBusData.cnapsBrname);
  },
  watch: {
    globalBusData: {
      handler(val) {
        this.$set(this.form, "payeeBrno", val.cnapsBrno);
        this.$set(this.form, "payeeBrname", val.cnapsBrname);
        this.$set(this.form, "payeeAccBrno", val.cnapsBrno);
        this.$set(this.form, "payeeAccBrname", val.cnapsBrname);
      },
      deep: true,
      immediate: true,
    },
    feeIdRegionidChange: {
      handler(val) {
        let endorserNumber = val.endorserNumber;
        let bizCtgyCode = val.bizCtgyCode;
        let bizCtgyCodes = ["03401","03402","03403","03404","03405","03406"];
        if (endorserNumber == 0 && bizCtgyCodes.includes(bizCtgyCode)) {
          this.$set(this.rules.oriPayeeName[0], "required", false);
        } else {
          this.$set(this.rules.oriPayeeName[0], "required", true);
        }
      },
    },

    "form.bizTypeCode": {
      handler(val) {
        this.isamountdisable = false;
        this.isremarkdisable = false;
        if (val === "B104") {
          this.isamountdisable = true;
        } else if (val === "B307") {
          this.isamountdisable = true;
        } else if (val === "A119") {
          this.isremarkdisable = false;
        }
      },
    },

    "form.bizCtgyCode": {
      handler(val) {
        if (!this.ifShowDelBtn) {
          if ("03406" === val) {
            this.$set(this.rules.draftKey[0], "required", true);
            this.$set(this.rules.applyName[0], "required", true);
            this.$set(this.form, "payerActno", "0");
            this.$set(this.form, "payerName", "0");
            this.ispayerActnodisable = true;
            this.ispayerNamedisable = true;
          } else {
            this.$set(this.rules.draftKey[0], "required", false);
            this.$set(this.rules.applyName[0], "required", false);
            this.$set(this.form, "payerActno", "");
            this.$set(this.form, "payerName", "");
          }

          if ("03402" === val) {
            this.$set(this.rules.draftKey[0], "required", true);
            this.$set(this.rules.applyName[0], "required", true);
            this.$set(this.rules.applyAccount[0], "required", true);
            this.$set(this.form, "payerActno", "0");
            this.$set(this.form, "payerName", "0");
            // 附加信息
            this.$set(this.rules.draftMaturity[0], "required", true);
          } else {
            this.$set(this.rules.draftKey[0], "required", true);
            this.$set(this.rules.applyName[0], "required", true);
            this.$set(this.rules.applyAccount[0], "required", true);
            if("03406" !== val){
              this.$set(this.form, "payerActno", "");
              this.$set(this.form, "payerName", "");
            }
            this.$set(this.rules.draftMaturity[0], "required", false);
          }

          if ("03403" === val) {
            this.$set(this.rules.draftMaturity[0], "required", true);
            this.$set(this.rules.acceptDate[0], "required", false);
            this.$set(this.rules.acceptor[0], "required", false);
            this.$set(this.rules.pactNumber[0], "required", true);
            this.$set(this.rules.protoNo[0], "required", false);
          } else {
            this.$set(this.rules.draftMaturity[0], "required", false);
            this.$set(this.rules.acceptDate[0], "required", true);
            this.$set(this.rules.acceptor[0], "required", true);
            this.$set(this.rules.pactNumber[0], "required", false);
            this.$set(this.rules.protoNo[0], "required", true);
          }

          if ("03404" === val) {
            this.$set(this.rules.draftMaturity[0], "required", true);
            this.$set(this.rules.acceptDate[0], "required", true);
            this.$set(this.rules.acceptor[0], "required", true);
            this.$set(this.rules.protoNo[0], "required", true);
            this.$set(this.rules.issueAccount[0], "required", true);
            this.$set(this.rules.issueName[0], "required", true);
          } else {
            if("03403" !== val){
              this.$set(this.rules.draftMaturity[0], "required", false);
            }
            this.$set(this.rules.acceptDate[0], "required", true);
            this.$set(this.rules.acceptor[0], "required", true);
            this.$set(this.rules.protoNo[0], "required", true);
            this.$set(this.rules.issueAccount[0], "required", false);
            this.$set(this.rules.issueName[0], "required", false);
          }

          if ("03405" === val) {
            this.$set(this.rules.issueAccount[0], "required", true);
            this.$set(this.rules.issueName[0], "required", true);
          }

          //最后设置属性选填
          if("03402" === val){
            this.payerActnobuttonhidden = "none";
            //“付款人账号”、“付款人名称”输入框置灰
            this.ispayerActnodisable = true;
            this.ispayerNamedisable = true;
          // “承兑协议编号”、“承兑日期”、“承兑人”为选填项
            this.$set(this.rules.protoNo[0], "required", false);
            this.$set(this.rules.acceptDate[0], "required", false);
            this.$set(this.rules.acceptor[0], "required", false);

          }else if("03403" === val){
            this.payerActnobuttonhidden = "";
            this.ispayerActnodisable = false;
            this.ispayerNamedisable = false;
            // 票据密押、承兑协议编号、申请人账号、申请人名称”字段为选填项
            this.$set(this.rules.draftKey[0], "required", false);
            this.$set(this.rules.protoNo[0], "required", false);
            this.$set(this.rules.applyAccount[0], "required", false);
            this.$set(this.rules.applyName[0], "required", false);

          }else if("03404" === val){
            this.payerActnobuttonhidden = "";
            this.ispayerActnodisable = false;
            this.ispayerNamedisable = false;
            // 票据密押、申请人账号、申请人名称”字段为选填项
            this.$set(this.rules.draftKey[0], "required", false);
            this.$set(this.rules.applyAccount[0], "required", false);
            this.$set(this.rules.applyName[0], "required", false);

          }else if("03405" === val){
            this.payerActnobuttonhidden = "";
            this.ispayerActnodisable = false;
            this.ispayerNamedisable = false;
            // “票据密押”、“承兑协议编号”、“承兑日期”、“承兑人”、“申请人账号”、“申请人名称”是选填项
            this.$set(this.rules.draftKey[0], "required", false);
            this.$set(this.rules.protoNo[0], "required", false);
            this.$set(this.rules.acceptDate[0], "required", false);
            this.$set(this.rules.acceptor[0], "required", false);
            this.$set(this.rules.applyAccount[0], "required", false);
            this.$set(this.rules.applyName[0], "required", false);
          }else if("03406" === val){
            this.payerActnobuttonhidden = "none";
            //“付款人账号”、“付款人名称”输入框置灰
            this.ispayerActnodisable = true;
            this.ispayerNamedisable = true;
            // “承兑协议编号”、“承兑日期”、“承兑人”、“申请人账号”是选填项
            this.$set(this.rules.protoNo[0], "required", false);
            this.$set(this.rules.acceptDate[0], "required", false);
            this.$set(this.rules.acceptor[0], "required", false);
            this.$set(this.rules.applyAccount[0], "required", false);

          }else{
            this.payerActnobuttonhidden = "";
            this.ispayerActnodisable = false;
            this.ispayerNamedisable = false;
            this.$set(this.rules.issueAccount[0], "required", false);
            this.$set(this.rules.issueName[0], "required", false);
          }


        }
      },
    },

    "form.payerBrno": {
      handler(val) {
        if (val !== "" && val !== undefined) {
          checkRcvStBrnoStatus(val, "BEPS");
        }
      },
    },

    // "form.listB104": {
    //   handler(val) {
    //     if (val.length !== 0) {
    //       this.$set(this.form, "dtlCount1", val.length);
    //       this.$set(this.form, "dtlCurcd1", "CNY");
    //       let sum = 0;
    //       val.forEach((data) => {
    //         sum += Number(data.amount);
    //       });
    //       sum.toFixed(2);
    //       this.$set(this.form, "dtlAmount1", sum);
    //       this.$set(this.form, "amount", sum);
    //     }
    //   },
    // },

    "detailList104": {
      handler(val) {
        if (val.length !== 0) {
          this.$set(this.form, "dtlCount1", val.length);
          this.$set(this.form, "dtlCurcd1", "CNY");
          let sum = 0;
          val.forEach((data) => {
            sum += Number(data.amount);
          });
          sum.toFixed(2);
          this.$set(this.form, "dtlAmount1", sum);
          this.$set(this.form, "amount", sum);
        }
        }
      },

    // "form.listB307": {
    //   handler(val) {
    //     if (val.length !== 0) {
    //       this.$set(this.form, "dtlCount2", val.length);
    //       this.$set(this.form, "dtlCurcd2", "CNY");
    //       let sum = 0;
    //       val.forEach((data) => {
    //         sum += Number(data.capitalAmount) + Number(data.accrualAmount);
    //       });
    //       sum.toFixed(2);
    //       this.$set(this.form, "dtlAmount2", sum);
    //       this.$set(this.form, "amount", sum);
    //     }
    //   },
    // },

    "detailList307": {
      handler(val) {
        if (val.length !== 0) {
          this.$set(this.form, "dtlCount2", val.length);
          this.$set(this.form, "dtlCurcd2", "CNY");
          let sum = 0;
          val.forEach((data) => {
            sum += Number(data.capitalAmount) + Number(data.accrualAmount);
          });
          sum.toFixed(2);
          this.$set(this.form, "dtlAmount2", sum);
          this.$set(this.form, "amount", sum);
        }
      }
    },
  },
  mounted() {
  },
  methods: {
    //切换每页显示数据量时的回调
    handleSizeChange104 (size) {
      this.pageSize = size;
      this.handleCurrentChange104(this.currentPage);
    },
    handleSizeChange307 (size) {
      this.pageSize307 = size;
      this.handleCurrentChange307(this.currentPage307);
    },
    handleSizeChangeEndorser (size) {
      this.endorserPageSize = size;
      this.handleCurrentChangeEndorser(this.endorserCurPage);
    },

    //切换页码回调
    handleCurrentChange104 (currentPage) {
      let page = this.detailList104.slice((currentPage-1)*this.pageSize,currentPage*this.pageSize);
      this.$refs.dataTable104.dataList = page
      this.currentPage = currentPage;
    },
    handleCurrentChange307 (currentPage) {
      let page = this.detailList307.slice((currentPage-1)*this.pageSize307,currentPage*this.pageSize307);
      this.$refs.dataTable307.dataList = page
      this.currentPage307 = currentPage;
    },
    handleCurrentChangeEndorser(currentPage) {
      let page = this.endorserList.slice((currentPage-1)*this.endorserPageSize,currentPage*this.endorserPageSize);
      this.$refs.dataTableEndorser.dataList = page
      this.endorserCurPage = currentPage;
    },
    // 表单重置
    reset() {
      this.resetForm("editForm");
      this.$set(this, "form", {});
      this.detailList104 = [];
      this.detailList307 = [];
      this.endorserList = [];
    },
    // 关闭回掉
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          this.reset();
          done();
        })
        .catch((_) => {
        });
    },

    bizTypeCodeChange(code) {
      //联动修改bizCtgyCode
      let dictKeyPre = `BIZ_CTGY_BEPS_${code}`;
      this.getDicts(dictKeyPre).then((response) => {
        this.busTypeList = response.result;
        this.$set(this.form, "bizCtgyCode", this.busTypeList[0].value);
      });
    },

    // 回车查证账号信息
    getActNoInfo(actNoType) {
      if (actNoType === "payeeActNo") {
        var actNo = this.form.payeeActno;
        getCustByActno(actNo).then((response) => {
          if (response.code == "S" && response.result !== null) {
            this.$set(this.form, "payeeActno", response.result.actNo);
            this.$set(this.form, "payeeName", response.result.name);
            // this.$set(this.form, "payeeBrno", response.result.rcvBrno);
            // this.$set(this.form, "payeeBrname", response.result.rcvBrname);
            this.$set(this.form, "payeeAddr", response.result.addr);
            // this.$set(this.form, "payeeAccBrno", response.result.accBrno);
            // this.$set(this.form, "payeeAccBrname", response.result.accBrnoName);
          } else {
            this.msgSuccess("无历史付款记录");
            this.$set(this.form, "payeeName", null);
            // this.$set(this.form, "payeeBrno", null);
            // this.$set(this.form, "payeeBrname", null);
            this.$set(this.form, "payeeAddr", null);
            // this.$set(this.form, "payeeAccBrno", null);
            // this.$set(this.form, "payeeAccBrname", null);
          }
        });
      } else {
        var actNo = this.form.payerActno;
        getOtherCustByActno(actNo).then((response) => {
          if (response.code == "S" && response.result !== null) {
            this.$set(this.form, "payerActno", response.result.actNo);
            this.$set(this.form, "payerName", response.result.name);
            this.$set(this.form, "payerAddr", response.result.addr);
          } else {
            this.msgSuccess("查无此账号");
            this.$set(this.form, "payerName", null);
            this.$set(this.form, "payerAddr", null);
          }
        });
      }
    },
    // 检查大额交易金额上限
    checkAmountLimit() {
      isLessThenHvpsMinLimitNew(this.form.bizTypeCode, this.form.bizCtgyCode, this.form.bizPriority, this.form.amount);
    },

    openBankBranchDialog(fromFlag = "") {
      this.$refs.bankBranchDialog.show(fromFlag);
    },
    confirmBankBranch(fromFlag, row) {
      if (fromFlag == "payeeBrno") {
        this.$set(this.form, "payeeBrno", row.bankCode);
        this.$set(this.form, "payeeBrname", row.orgFullname);
      } else if (fromFlag == "payerAccBrno") {
        this.$set(this.form, "payerAccBrno", row.bankCode);
        this.$set(this.form, "payerAccBrname", row.orgFullname);
      } else if (fromFlag == "payerBrno") {
        this.$set(this.form, "payerBrno", row.bankCode);
        this.$set(this.form, "payerBrname", row.orgFullname);
      } else if (fromFlag == "payeeAccBrno") {
        this.$set(this.form, "payeeAccBrno", row.bankCode);
        this.$set(this.form, "payeeAccBrname", row.orgFullname);
      } else if (fromFlag == "agency1") {
        this.$set(this.form, "agency1", row.bankCode);
        this.$set(this.form, "agency1name", row.orgFullname);
      } else if (fromFlag == "agency2") {
        this.$set(this.form, "agency2", row.bankCode);
        this.$set(this.form, "agency2name", row.orgFullname);
      }
    },
    //回车取行号信息
    getBankInf(searchType, bankCode) {
      getBankInfByBankCode(bankCode).then((response) => {
        if (response.code == "S" && response.result !== null) {
          switch (searchType) {
            case "payerBrno":
              this.$set(this.form, "payerBrno", response.result.bankCode);
              this.$set(this.form, "payerBrname", response.result.orgFullname);
              break;
            case "payerAccBrno":
              this.$set(this.form, "payerAccBrno", response.result.bankCode);
              this.$set(this.form, "payerAccBrname", response.result.orgFullname);
              break;
            case "payeeBrno":
              this.$set(this.form, "payeeBrno", response.result.bankCode);
              this.$set(this.form, "payeeBrname", response.result.orgFullname);
              break;
            case "payeeAccBrno":
              this.$set(this.form, "payeeAccBrno", response.result.bankCode);
              this.$set(this.form, "payeeAccBrname", response.result.orgFullname);
              break;
            case "agency1":
              this.$set(this.form, "agency1", response.result.bankCode);
              this.$set(this.form, "agency1name", response.result.orgFullname);
              break;
            case "agency2":
              this.$set(this.form, "agency2", response.result.bankCode);
              this.$set(this.form, "agency2name", response.result.orgFullname);
              break;
          }
        } else {
          this.msgSuccess("查无此行号");
          switch (searchType) {
            case "payerBrno":
              this.$set(this.form, "payerBrname", null);
              break;
            case "payerAccBrno":
              this.$set(this.form, "payerAccBrname", null);
              break;
            case "payeeBrno":
              this.$set(this.form, "payeeBrname", null);
              break;
            case "payeeAccBrno":
              this.$set(this.form, "payeeAccBrname", null);
              break;
            case "agency1":
              this.$set(this.form, "agency1name", null);
              break;
            case "agency2":
              this.$set(this.form, "agency2name", null);
              break;
          }
        }
      });
    },
    openPayeeDialog(fromFlag = "") {
      this.$refs.payeeDialog.show(fromFlag);
    },
    confirmPayee(fromFlag, row) {
      if (fromFlag == "payeeActno") {
        this.$set(this.form, "payeeActno", row.actNo);
        this.$set(this.form, "payeeName", row.name);
        // this.$set(this.form, "payeeBrno", row.rcvBrno);
        // this.$set(this.form, "payeeBrname", row.rcvBrname);
        this.$set(this.form, "payeeAddr", row.addr);
        // this.$set(this.form, "payeeAccBrno", row.accBrno);
        // this.$set(this.form, "payeeAccBrname", row.accBrnoName);
      }
    },
    openPayerDialog(fromFlag = "") {
      this.$refs.payerDialog.show(fromFlag);
    },
    confirmPayer(fromFlag, row) {
      if (fromFlag == "payerActno") {
        this.$set(this.form, "payerActno", row.actNo);
        this.$set(this.form, "payerName", row.name);
        this.$set(this.form, "payerAddr", row.addr);
        this.$set(this.form, "payerBrno", row.rcvBrno);
        this.$set(this.form, "payerBrname", row.rcvBrname);
        this.$set(this.form, "payerAccBrno", row.accBrno);
        this.$set(this.form, "payerAccBrname", row.accBrnoName);
      }
    },
    show(id = "", pkgNo = "") {
      this.reset();
      this.pkgNo = pkgNo;
      this.id = id;
      this.title = "小额普通借记业务录入";
      this.openState = true;
      this.ifShowDelBtn = false;
      this.form.dtlCount1 = 0;
      this.form.dtlCount2 = 0;
      this.form.dtlAmount1 = 0.0;
      this.form.dtlAmount2 = 0.0;
      this.form.dtlCurcd1 = "CNY";
      this.form.dtlCurcd2 = "CNY";

      // 初始化选择
      this.$set(this.form, "bizTypeCode", this.dictMap.BIZ_TYPE_127[0].value);
      this.$set(this.form, "bizPriority", this.dictMap.PRIORITY3CODE[0].value);
      this.$set(this.form, "custflag1", this.dictMap.CUST_FLAG1[0].value);
      // this.$set(this.form, "cbflag", this.dictMap.CBFLAG[0].value);
      this.$set(this.form, "listB104", []);
      this.$set(this.form, "listB307", []);
      this.$set(this.form, "listEndorser", []);

      this.$set(this.form, "curcd", "CNY");
      this.$set(this.form, "dtlCurcd1", "CNY");
      this.$set(this.form, "issueCurrcd", "CNY");
      this.$set(this.form, "endorserNumber", "0");

      this.$set(this.form, "payeeBrno", this.globalBusData.cnapsBrno);
      this.$set(this.form, "payeeBrname", this.globalBusData.cnapsBrname);
      this.$set(this.form, "payeeAccBrno", this.globalBusData.cnapsBrno);
      this.$set(this.form, "payeeAccBrname", this.globalBusData.cnapsBrname);

      //this.$set(this.form, "payerBrno", cnapsUserInfo.cnapsBrno); 付款行号需要初始化
      if (id) {
        this.title = "小额普通借记业务修改";
        this.ifShowDelBtn = true;

        // 如果传了ID 这里查询一个已经存在的数据
        bepsDebitBusinessModifyDetail({
          id: this.id,
          pkgId: this.pkgNo,
        }).then((res) => {
          this.$set(this, "form", res.result);
          this.$set(this.queryParams, "id", this.form.id);
          this.bizTypeCodeChange(this.form.bizTypeCode);
          if (
            this.form.bizTypeCode === "B309" ||
            this.form.bizTypeCode === "B310" ||
            this.form.bizTypeCode === "B311"
          ) {
            this.$set(this.form, "payDate_B309", this.form.payDate);
            this.$set(this.form, "issueDate_B309", this.form.issueDate);
          }
          if (this.form.imgFrnName !== undefined) {
            let imgFrnFileName = this.form.imgFrnName.split("||");
            if (imgFrnFileName.length > 1) {
              this.$set(this.form, "imgFrnFileName", imgFrnFileName[1]);
              this.$set(this.form, "imgFrnDownload", this.form.imgFrnName);
            }
          }
          if (this.form.imgBckName !== undefined) {
            let imgBckFileName = this.form.imgBckName.split("||");
            if (imgBckFileName.length > 1) {
              this.$set(this.form, "imgBckFileName", imgBckFileName[1]);
              this.$set(this.form, "imgBckDownload", this.form.imgBckName);
            }
          }

          //明细列表查询(修改用)
          if (this.form.bizTypeCode == "B104") {
            detailByCode({id: this.form.id, code: "B104"}
            ).then(res =>{
              this.$refs.dataTable104.dataList = res.result;
              this.detailList104= res.result;

            })
          } else if (this.form.bizTypeCode == "B307") {
            detailByCode({id: this.form.id, code: "B307"}
            ).then(res =>{
              this.$refs.dataTable307.dataList = res.result;
              this.detailList307= res.result;
            })
          }


        });
      } else {
        this.bizTypeCodeChange(this.form.bizTypeCode);
      }
    },

    cancel() {
      this.openState = false;
      this.reset();
      this.$emit("editComplete", false);
    },
    submitCheck(res) {
      if (res.code === "C") {
        this.$confirm(res.message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.submitForm(res.result);
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消执行'
          });
          return;
        });
      }
    },
    /** TODO提交按钮 */
    submitForm: function (pass) {
      this.$refs["editForm"].validate((valid) => {
        if (valid) {
          if (
            this.form.bizTypeCode === "B309" ||
            this.form.bizTypeCode === "B310" ||
            this.form.bizTypeCode === "B311"
          ) {
            this.$set(this.form, "issueDate", this.form.issueDate_B309);
            this.$set(this.form, "payDate", this.form.payDate_B309);
          }
          if (this.$refs.dataTable104 !== undefined) {
            this.$set(this.form, "listB104", this.$refs.dataTable104.dataList);
          }
          if (this.$refs.dataTable307 !== undefined) {
            this.$set(this.form, "listB307", this.$refs.dataTable307.dataList);
          }
          if (this.$refs.dataTableEndorser !== undefined) {
            this.$set(this.form, "listEndorser", this.$refs.dataTableEndorser.dataList);
          }
          this.form.pass = pass;
          this.$set(this.form, "listB104", this.detailList104)
          this.$set(this.form, "listB307", this.detailList307)
          this.$set(this.form, "listEndorser", this.endorserList)
          //如果有ID 则是修改
          if (this.id) {
            update127(this.form).then((res) => {
              this.submitCheck(res);
              if (res.code === "S") {
                this.msgSuccess("修改成功");
                this.$emit("editComplete", true);
                this.openState = false;
              }
            });
          } else {
            add127(this.form)
              .then((res) => {
                this.submitCheck(res);
                if (res.code === "S") {
                  this.msgSuccess("新增成功");
                  this.$alert(`CORE_ID: ${res.result.rspId}`, "生成交易流水号", {
                    confirmButtonText: "确定",
                    //刷新一下查询列表 TODO
                    callback: (action) => {
                    },
                  });
                  this.$emit("editComplete", true);
                  this.openState = false;
                }
              })
              .catch((res) => {
              });
          }
        }
      });
    },
    /** 删除 按钮 */
    delTran: function () {
      if (this.id) {
        delTxn({id: this.id}).then((res) => {
          this.form.userInfo = {brno: "676", userId: "cpg001"};

          this.msgSuccess("修改成功");
          this.openState = false;
          this.$emit("editComplete", true);
        });
      }
    },

    //table104操作方法
    confirmlistB104detail(form, index) {
      if (index !== undefined) {
        this.$set(this.detailList104, (this.currentPage-1) * this.pageSize + index, form);
        this.$refs.dataTable104.dataList = this.detailList104
        this.handleCurrentChange104(this.currentPage);
      } else {
        this.$refs.dataTable104.dataList.push(form);
        this.detailList104.push(form)
        this.handleCurrentChange104(this.currentPage);
      }
      this.$set(this.form, "listB104", this.$refs.dataTable104.dataList);
    },

    remove104(row, index) {

      let delIndex = (this.currentPage-1) * this.pageSize + index;
      this.detailList104.splice(delIndex, 1);
      this.$refs.dataTable104.dataList = this.detailList104
      if(index === 0 && this.currentPage !== 1){
        this.handleCurrentChange104(this.currentPage-1);
      }else {
        this.handleCurrentChange104(this.currentPage);
      }
      if (this.$refs.dataTable104.dataList.length !== 0) {
        this.$set(this.form, "dtlCount1", this.detailList104.length);
        this.$set(this.form, "dtlCurcd1", "CNY");
        let sum = 0;
        this.detailList104.forEach((data) => {
          sum += Number(data.amount);
        });
        sum.toFixed(2);
        this.$set(this.form, "dtlAmount1", sum);
        this.$set(this.form, "amount", sum);
      } else {
        this.$set(this.form, "dtlCount1", "0");
        this.$set(this.form, "dtlAmount1", "0");
        this.$set(this.form, "amount", "0");
      }
      this.$set(this.form, "listB104", this.$refs.dataTable104.dataList);
    },

    update104(row, index) {
      this.$refs.listB104Dialog.show(row, index);
    },

    addRow104() {
      this.$refs.listB104Dialog.show();
    },

    //table307操作方法

    confirmlistB307detail(form, index) {
      if (index !== undefined) {
        this.$set(this.detailList307, (this.currentPage307-1) * this.pageSize307 + index, form);
        this.$refs.dataTable307.dataList = this.detailList307
        this.handleCurrentChange307(this.currentPage307);
      } else {
        this.$refs.dataTable307.dataList.push(form);
        this.detailList307.push(form)
        this.handleCurrentChange307(this.currentPage307);
      }
      this.$set(this.form, "listB307", this.$refs.dataTable307.dataList);
    },

    remove307(row, index) {
      let delIndex = (this.currentPage307-1) * this.pageSize307 + index;
      this.detailList307.splice(delIndex, 1);
      this.$refs.dataTable307.dataList = this.detailList307
      if(index === 0 && this.currentPage307 !== 0){
        this.handleCurrentChange307(this.currentPage307-1);
      }else {
        this.handleCurrentChange307(this.currentPage307);
      }
      if (this.$refs.dataTable307.dataList.length !== 0) {
        this.$set(this.form, "dtlCount2", this.detailList307.length);
        this.$set(this.form, "dtlCurcd2", "CNY");
        let sum = 0;
        this.detailList307.forEach((data) => {
          sum += Number(data.amount);
        });
        sum.toFixed(2);
        this.$set(this.form, "dtlAmount2", sum);
        this.$set(this.form, "amount", sum);
      } else {
        this.$set(this.form, "dtlCount2", "0");
        this.$set(this.form, "dtlAmount2", "0");
        this.$set(this.form, "amount", "0");
      }
      this.$set(this.form, "listB307", this.$refs.dataTable307.dataList);
    },

    update307(row, index) {
      this.$refs.listB307Dialog.show(row, index);
    },

    addRow307() {
      this.$refs.listB307Dialog.show();
    },

    //背书表格
    addListEndorser() {
      let endorserName = this.form.endorserName;
      if (endorserName === "" || endorserName === undefined) {
        this.msgError("请输入被背书人名称");
      } else {
        this.$refs.dataTableEndorser.dataList.push({endorserName: this.form.endorserName});
        this.endorserList.push({endorserName: this.form.endorserName})
        this.$set(this.form, "endorserNumber", this.endorserList.length);
        this.$set(this.form, "listEndorser", this.$refs.dataTableEndorser.dataList);
        this.$set(this.form, "endorserName", "");
        this.handleCurrentChangeEndorser(this.endorserCurPage);
      }
    },
    //删除背书表格
    removeEndorser(row, index) {
      let delIndex = (this.endorserCurPage-1) * this.endorserPageSize + index;
      this.endorserList.splice(delIndex, 1);
      this.$refs.dataTableEndorser.dataList = this.endorserList
      if(index === 0 && this.endorserCurPage !== 1){
        this.handleCurrentChangeEndorser(this.endorserCurPage-1);
      }else {
        this.handleCurrentChangeEndorser(this.endorserCurPage);
      }
      this.$set(this.form, "listEndorser", this.$refs.dataTableEndorser.dataList);
      this.$set(this.form, "endorserNumber", this.endorserList.length);
    },

    //上传文件组件返回
    frnsuccessCallback(res) {
      if (res.code === "S") {
        console.log(res);
        this.$set(this.form, "imgFrnName", res.result.fileId + "||" + res.result.fileOriginName);
        this.$set(this.form, "imgType", res.result.fileSuffix);
        this.$set(this.form, "imgFrnLen", res.result.fileSize);
      }
    },

    bcksuccessCallback(res) {
      if (res.code === "S") {
        this.$set(this.form, "imgBckName", res.result.fileId + "||" + res.result.fileOriginName);
        this.$set(this.form, "imgBckLen", res.result.fileSize);
      }
    },
    downloadFile(fileId) {
      if (fileId !== undefined && fileId !== "") {
        downloadfile(`${baseUrlConfig.downloadFile}`, fileId).then((response) => {
          let blob = new Blob([response.data], {type: "image/jpeg"});
          console.log(response);
          let objectUrl = URL.createObjectURL(blob);
          const link = document.createElement("a"); // 创建a标签
          link.href = objectUrl;
          // const fileNameSplit = response.headers['content-disposition'].split('=')
          // const fileName = decodeURI(fileNameSplit[fileNameSplit.length - 1]) // 跟后端约定好最后一个值为fileName字段
          link.download = fileId.split("||")[1]; // 自定义文件名

          link.click(); // 下载文件
          URL.revokeObjectURL(objectUrl); // 释放内存
        });
      } else {
        this.msgError("下载文件不存在");
      }
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
